<?php
/**
 * Created by PhpStorm.
 * User: o0无忧亦无佈(285753421@qq.com)
 * Date: 15-2-2
 * Time: 下午5:42
 */
 /*订单信息*/
class order extends MY_User_Controller{

    protected $company_id;
    function __construct(){
        parent::__construct();
        $this->load->model('company/company_order');
        $this->company_id = $this->session->userdata("company_id");
    }

    function index($state = 0,$page = 0){
        $offset = ($page-1)*10;
        $order_list = $this->company_order->get_order_by_id($this->company_id,$order_by = 'id',$state,10, $offset);

        $this->assign('order',$order_list);
        $this->display();
    }

    function del($order_id){
        echo "company can't do of method";
    }

    function complete($order_id){
        $result =  $this->company_order->complete($this->company_id,$order_id);
        if(!$result){
            $this->json_response(false);
        }
        $this->json_response(true);
    }

    function show(){
        $message = trim($this->input->post('info'));
        $this->load->model('public/file_base');
        foreach(array_keys($message) as $id)
        {
            array_push($ids,$id);
        }
        $document_list = $this->file_base->get_file_by_id($ids);
        $this->json_response(true,$document_list);
    }




}